﻿/*
 * LdAttrCollection
 * 
 * initial implementation : 26.6.2013
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see cz.uhul.DSMLv2.txt
 */
using System;
using System.Collections.ObjectModel;
using System.Web;


namespace cz.uhul.DSMLv2
{
  public class LdAttrCollection : ObservableCollection<LdAttr>
  {



    public bool ContainsName(string attributeName)
    {

      foreach (LdAttr a in this)
        if (a.Name.ToLower() == attributeName.ToLower())
          return true;

      return false;
      
    }




    public LdAttr this[string attributeName]
    {
      get
      {
        foreach (LdAttr a in this)
          if (a.Name.ToLower() == attributeName.ToLower())
            return a;

        return null;
      }
    }
  

  }
}